home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / rsxwdk2s.zip / RSXWDK / LIBSRC / DOS / DOS3E.C < prev    next >
C/C++ Source or Header  |  1994-12-17  |  351b  |  25 lines

  1. #include <errno.h>
  2. #include <sys/doscalls.h>
  3.  
  4. /*
  5. ** AH = 0x3E
  6. ** BX = file handle
  7. ** return: -1 on error
  8. */
  9. int dos_close(int handle)
  10. {
  11.     struct REGPACK r;
  12.  
  13.     r.eax = 0x3E00;
  14.     r.ebx = handle;
  15.  
  16.     _intr(0x21, &r);
  17.  
  18.     if (r.eflags & 1) {
  19.     _sys_doserror2errno( r.eax & 0xFFFF);
  20.     return (-1);
  21.     }
  22.     else
  23.     return 0;
  24. }
  25.